package com.iweb.service;

import com.common.datasource.DataSourceUtil;
import com.iweb.dao.OrderDao;
import com.iweb.dao.OrderDaoImpl;
import com.iweb.pojo.Order;

public class OrderService {
	public void addOrder(Order order) {
		// 链接数据库
		DataSourceUtil dataSourceUtil = new DataSourceUtil();
		dataSourceUtil.init();
		// 创建数据库操作对象

		OrderDao orderDao = new OrderDaoImpl(dataSourceUtil.getConnection());
		try {
			orderDao.addOrder(order);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			dataSourceUtil.close();
		}
	}
}
